zprogram Runge_Kutta 
implicit none
integer :: i
real :: k1,k2,k3,k4,y1,y2,t1,t2
real,parameter :: h = .1

t1 = 0
y1 = 1

open(1,file='question2')
write(1,*)t1,y1

do i= 1,40

k1=f(t1,y1)
k2=f(t1+h/2,y1+h*k1/2)
k3=f(t1+h/2,y1+h*k2/2)
k4=f(t1+h,y1+h*k3)

y2=y1+h*(k1+2*k2+2*k3+k4)/6

t2 = t1+0.1
t1 = t2
y1 = y2
write(1,*)t2,y2
end do

contains
real function f(a,b)
real,intent(in) :: a,b
f = a**2 - b
end function
end program 
